<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/modules/cms/front/include/taglib.jsp" %>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="decorator" content="default"/>
    <title>店铺管理</title>
    <link href="${ctxStatic}/merchant/css/layui.css" rel="stylesheet" type="text/css">
    <link href="${ctxStatic}/merchant/css/index.css" rel="stylesheet" type="text/css">
    <link href="${ctxStatic}/merchant/css/register4.css" rel="stylesheet" type="text/css">
    <link href="${ctxStatic}/merchant/css/register5.css" rel="stylesheet" type="text/css">
    <script type="text/javascript">
        $(document).ready(function () {
            $("input[type='checkbox']").change(function () {
                if ($("input[type='checkbox']").is(':checked')) {
                    $("#submit").css('background-color', '#ef593c');
                    $("#submit").removeAttr('disabled');
                } else {
                    $("#submit").css('background-color', '#ccc');
                    $("#submit").attr('disabled', 'true');
                }
            });

            $('#prev').on('click', function () {
                window.location.href = "register3.html";
            });
            //$("#name").focus();
            $("#inputForm").validate({
                submitHandler: function (form) {
                    loading('正在跳转，请稍等...');
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function (error, element) {
                    $("#messageBox").text("输入有误，请先更正。");
                    if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
        });

    </script>
</head>
<body>
<form:form id="inputForm" modelAttribute="hkUserShop" action="${ctx}/saveHkUserShopForm" method="post">
    <form:hidden path="id"/>
    <sys:message content="${message}"/>
    <header>
        <div class="register-title">
            <span>商户入驻</span>
        </div>
    </header>
    <div class="content">
        <div class="store-info store">
            <span class="title">店铺基本信息<i class="warntitle">带*号为必填项</i></span>
            <div class="info">
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>主营类目：</label>
                    <div class="layui-input-block">
                        <sys:treeselect id="categoryId" name="category.id" labelName="category.name"
                                        labelValue="${hkUserShop.category.name}" value="${hkUserShop.category.id}"
                                        title="类目" url="/shop/category/hkShopCategory/merchTreeData" cssClass=""/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>店铺名称：</label>
                    <div class="layui-input-block">
                        <form:input path="name" htmlEscape="false" type="text" name="address"
                                    style="height: 50px;border-radius: 4px;font-size: 16px;color: #333;"
                                    lay-verify="required" placeholder="请输入店铺名称"
                                    autocomplete="off" class="layui-input"/>
                        <span>入驻后店铺名称不可修改，请谨慎填写</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>登录账号：</label>
                    <div class="layui-input-block">
                        <input type="text" name="address"
                               style="height: 50px;border-radius: 4px;font-size: 16px;color: #333;"
                               lay-verify="required" value='<%=request.getSession().getAttribute("loginName")%>'
                               autocomplete="off" class="layui-input" readonly="true"/>
                        <span>该登录账号为商家后台账号，请牢记</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>设置密码：</label>
                    <div class="layui-input-block">
                        <form:password path="shopPassword" id="shopPassword" htmlEscape="false"
                                       style="height: 50px;border-radius: 4px;font-size: 16px;color: #333;"
                                       autocomplete="off"
                                       placeholder="请输入密码"
                                       class="layui-input"/>
                            <%--<input id="shopPassWord" name="shopPassWord" type="password" value="" maxlength="50" minlength="3" class="required"/>--%>
                        <span>8~20个字，包含大小写字母、数字</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color:red;">*</span>确认密码：</label>
                    <div class="layui-input-block">
                        <input type="password" id="reShopPassWord" name="reShopPassWord"
                               style="height: 50px;border-radius: 4px;font-size: 16px;color: #333;"
                               lay-verify="required" placeholder="请再次输入密码"
                               autocomplete="off" class="layui-input"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="goods-info shop">
            <span class="title">商品信息<a>上传优质商品信息，有助于加快店铺审核进度</a></span>
            <div class="info">
                <div class="layui-form-item">
                    <label class="layui-form-label">备售商品名称：</label>
                    <div class="layui-input-block">
                        <form:input path="commodityName" htmlEscape="false" type="text" name=""
                                    style="height: 50px;border-radius: 4px;font-size: 16px;color: #333;"
                                    lay-verify="required" placeholder="请输入商品名称（最多30个字）"
                                    autocomplete="off" class="layui-input"/>
                    </div>
                </div>
                <div class="layui-form-item money">
                    <label class="layui-form-label">商品价格：</label>
                    <div class="layui-input-block">
                        <form:input path="commodityPrice" htmlEscape="false" type="text" name=""
                                    style="height: 50px;border-radius: 4px;font-size: 16px;color: #333;"
                                    lay-verify="required" placeholder="请输入商品价格"
                                    autocomplete="off" class="layui-input"/>
                        <span>(元)</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">商品图片：</label>
                    <div class="layui-input-block">
                        <div class="photo">
                            <input type="hidden" id="commodityImgSrc" name="commodityImgSrc"
                                   value="${hkUserShop.commodityImgSrc}"/>
                            <sys:ckfinder input="commodityImgSrc" type="thumb" uploadPath="/shop/shopInfo"
                                          selectMultiple="false"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="other-info">
            <span class="title">其他信息</span>
            <div class="info">
                <div class="layui-form-item">
                    <label class="layui-form-label">第三方店铺链接：</label>
                    <div class="layui-input-block">
                        <form:input path="otherShopLink" htmlEscape="false" type="text" name=""
                                    style="height: 50px;border-radius: 4px;font-size: 16px;color: #333;"
                                    lay-verify="required" placeholder="请输入商品标题（最多30个字）"
                                    autocomplete="off" class="layui-input"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">入驻推荐码：</label>
                    <div class="layui-input-block">
                        <form:input path="referralCode" htmlEscape="false" type="text" name=""
                                    style="height: 50px;border-radius: 4px;font-size: 16px;color: #333;"
                                    lay-verify="required" placeholder="请输入推荐码"
                                    autocomplete="off" class="layui-input"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <input type="checkbox" name="" title="我已阅读并同意" lay-skin="primary"/>
                        <span>我已阅读并同意</span>
                        <a class="agreement" onclick="window.open('${fns:getFrontPath()}/open')" target="_blank">《乐小转商家合作入驻协议》</a>
                    </div>
                </div>
            </div>
        </div>
        <div class="jump">
                <%--<input id="btnCancel" type="button" value="上一步" onclick="history.go(-1)"/>--%>
            <input id="submit" type="submit" value="提交"/>
        </div>
    </div>
</form:form>
<footer class="foot">
		<span>
			Copyright 2017-2018 lexiaozhuan.com 版权所有 (京ICP证030173号
		</span>
    <img src="${ctxStatic}/merchant/images/shouye/ghs.png">
    <span>
			京公网安备11000002000001号)
		</span>
</footer>
</body>
</html>